﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Common;
using DataAccessClasses;

namespace websoniBO
{
    public class Personal
    {
        iDAC DAC = DACFactory.GetDAC();
        private long _proid = -99;
        private string _show = "";
        private bool _isdeleted = false;
        public long proid
        {
            set { _proid = value; }
            get { return _proid; }
        }
      public string show
        {
            set { _show = value; }
            get { return _show; }
        }
        public bool isdeleted
        {
            set { _isdeleted = value; }
            get { return _isdeleted; }
        }

        public long SaveRecords()
        {
            try
            {
                DbParameter dbparam0 = DAC.Parameter("@proid", proid, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam2 = DAC.Parameter("@show", show, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam3 = DAC.Parameter("@isdeleted", isdeleted, DbType.Boolean, ParameterDirection.Input);
                DbParameter[] dbparamcall = new DbParameter[] { dbparam0, dbparam2, dbparam3 };
                return DAC.Save("professional_save", dbparamcall);
            }
            catch (Exception ex)
            {
                long Result = -99;
            }
            return -99;
        }
        public DataTable GetRecords(long proid,  string show, bool isdeleted, string paraandor)
        {
            try
            {
                DbParameter dbparam0 = DAC.Parameter("@proid", proid, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam2 = DAC.Parameter("@show", show, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam3 = DAC.Parameter("@isdeleted", isdeleted, DbType.Boolean, ParameterDirection.Input);
                DbParameter dbparam4 = DAC.Parameter("@paraandor", paraandor, DbType.AnsiString, ParameterDirection.Input);
                DbParameter[] dbparamcall = new DbParameter[] { dbparam0,  dbparam2, dbparam3, dbparam4 };
                DataTable dt1 = DAC.Select("professional_get", dbparamcall);
                return dt1;
            }
            catch (Exception ex)
            {
                long Result = -99;
            }
            return null;
        }
    }
}